<template>
  <div>
    <!-- van-tabs:
	   通过v-model绑定当前激活标签对应的索引值，默认情况下启用第一个标签
	   通过animated属性可以开启切换标签内容时的转场动画
	   通过swipeable属性可以开启滑动切换标签页
    -->
    <van-tabs v-model="active" animated swipeable>
      <van-tab :title="obj.name" v-for="obj in arr" :key="obj.id">
       <ArticleItem :obj='obj'></ArticleItem>
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import ArticleItem from './conponents/article-item.vue'
import { getMyChannels } from '@/api/channel'
export default {
  name: 'Home',
  components :{
  ArticleItem
  },
  data () {
    return {
      active: 0,
      arr:[]
    }
  },
  methods: {
    async getchanne(){
        const res = await getMyChannels()
        this.arr = res.data.channels
      
    }
  },
  created () {
    this.getchanne()
  }
}
</script>

<style lang="less" scoped>
 /deep/ .van-tabs__wrap {
  position: fixed;
  z-index: 1;
 }
 /deep/ .van-tab {
  border-right: 1px solid #000;
  // border: 1px solid #000;
 }
</style>